package com.example.demo.log;

import com.example.demo.log.service.DemoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoController {
    private static final Logger logger = LoggerFactory.getLogger(DemoController.class);

    @Autowired
    private DemoService demoService;

    @GetMapping("/test")
    public String test() {
        demoService.logTest();
//        logger.info("Info message (出现在根 Logger 的输出中)");
        return "Check logs!";
    }
}